package com.jingdianjichi.oss.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
    * ClassName :MinioConfig
    * Package :com.jingdianjichi.oss.config
    * Desciption :
    *@Author :
    *@Create : 23:13
    *@Version :1.0
*/

@Configuration
public class MinioConfig {
    /**
     * minioUrl
     */
    @Value("http://121.36.46.23:9000")
    private String url;

    /**
     * minio账户
     */
    @Value("minioadmin")
    private String accessKey;

    /**
     * minio密码
     */
    @Value("minioadmin")
    private String secretKey;

    /**
     * 构建minioClient
     */
    @Bean
    public MinioClient getMinioClinet(){
        return MinioClient.builder().endpoint(url).credentials(accessKey,secretKey).build();
    }

}
